﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class BreadCrumb_News : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string catid = Request.QueryString["catid"];
        if(catid!=null)
            ViewState["catid"] = catid;

        string newsid = Request.QueryString["newsid"];
        if(newsid!=null)
            ViewState["newsid"] = newsid;
    }
    public string cateName()
    {
        try
        {
            string cateid = TTQT.TTQT_Code.TTQTCommon.isNull(ViewState["catid"], "");
            string newsid = TTQT.TTQT_Code.TTQTCommon.isNull(ViewState["newsid"], "");
            CommonDAO dao=new CommonDAO();
            if(cateid.Length>0)
                return TTQT.TTQT_Code.TTQTCommon.isNull(dao.chayCauSQLScalarString("select [name] from tintuc_nhom where id="+cateid),"");
            if(newsid.Length>0)
            {
                return TTQT.TTQT_Code.TTQTCommon.isNull(dao.chayCauSQLScalarString("select [name] from tintuc_nhom where id in(select categoryid from news where newsid=" + newsid + ")"), "");
            }
        }catch(Exception exx)
        {
            return "";
        }
        return "";
    }
    public string formatSlash()
    {
        return cateName().Length > 0 ? "<span>&gt;</span>" : "";
    }
}
